import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)
import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

import * as obj from './directives'
//遍历这个对象,有多少就注册多少个指令
for (let key in obj) {
    Vue.directive(key, obj[key]);
}

//注册全局组件
// import headTool from '@/components/'
// Vue.component('headTool', headTool);
import Component from '@/components'
Vue.use(Component) // 注册自己的插件

//导入所有函数对象
import * as filters from '@/filters'
//遍历这个对象,注册成过滤器
for (let key in filters) {
    Vue.filter(key, filters[key])
}


//注册打印组件
import Print from 'vue-print-nb'
// Global instruction 
Vue.use(Print);

//判断按钮权限全局组件
import { roleObj } from "@/mixin/index";
Vue.mixin(roleObj);

Vue.config.productionTip = false

new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
})